#include <iostream>

using namespace std;

class Line
{
public:
    Line();    //构造函数声明
    ~Line();   //析构函数声明

    void setLength(double len);
    double getLength(void);

private:
    double length;
};

Line::Line(void)   //成员函数定义，构造函数
{
    cout << " object is being created " << endl;
}

Line::~Line(void)  //析构函数
{
    cout << " object is being deleted " << endl;
}

void Line::setLength(double len)
{
    length = len;
}

double Line::getLength(void)
{
    return length;
}

int main()
{
    Line line;

    line.setLength(8.0);
    cout << " Length of Line : " << line.getLength() << endl;

    return 0;
}
